How to: Add a command button.
Solution:
In the Form Design view, click 'Command Button' on the Toolbox to insert a command button. Click on the form to insert the 'Command Button' and follow the steps in the wizard.
1) If the Database window is not activated, activate the Database window.
2) Click the 'Forms' tab in the Database window.
Forms tab
3) Select the desired form from the list box. (The selected form is highlighted.)
4) Click 'Design'. (The selected form appears in Design view, and the floating Toolbox appears.)
5) Do one of the following:
a) To create a command button using the wizard, do the following:
1] Make sure the 'Control Wizard' button located in the Toolbox is depressed.
Control Wizard depressed and selected bound control
2] Click 'Command Button' on the Toolbox.
3] Position the mouse pointer on the form to select the location for the command button.
4] Click the location for the command button on the form. (The Command Button Wizard appears.)
5] Follow the wizard instructions.
b) To create a command button without using the wizard, do the following:
1] Click 'Control Wizard' located on the Toolbox.
NOTE: This turns OFF the wizard.
2] Position the mouse pointer on the form to select the location for the command button.
3] Click the location for the command button on the form. (The command button appears.)
4] Select the 'View' menu and select 'Properties'. (The property sheet appears for the command button.)
5] Click the 'Event' tab in the 'Properties' window.
6] Click on the 'On Click' property. (The Build button appears to the right of the property.)
7] Do one of the following:
a] Type the name of the macro.
b] Type the name of the event procedure.
c] Click 'Build'. (The Choose Builder dialog box appears.)
Build button
1} Select the 'Macro Builder' to create a macro.
a} Click 'OK'. (The Macro Save As dialog box appears.)
b} Type the name of the macro in the 'Save As' dialog box.
c} Click 'OK'. (The Macro screen appears.)
2} Select the 'Code Builder' to create code.
a} Click 'OK'. (The Macro Save As dialog box appears.)
b} Type the name of the macro in the 'Save As' dialog box.
c} Click 'OK'. (The Macro screen appears.)
8] Click the 'Format' tab in the 'Properties' window.
9] Click on the 'Caption' property.
10] Type the desired text to appear on the command button.
6) Select the 'File' menu and select 'Save' to save the form.